package com.qingcloud.base.api.remote.uaa.fallback;

import com.qingcloud.base.api.remote.uaa.UaaApi;
import com.qingcloud.base.exception.WamingExceptionEnum;
import com.qingcloud.base.pojo.ApiResult;
import com.qingcloud.base.pojo.Result;
import com.qingcloud.base.remote.executor.JobInstanceFileLog;
import com.qingcloud.base.remote.executor.JobRuntimeParam;
import com.qingcloud.base.remote.uaa.Client;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

@Slf4j
public class UaaApiFallback implements UaaApi {

    @Setter
    private Throwable cause;

    @Override
    public Client getClients(Long id){
        log.error("getClients:{}", id, cause);
        cause.printStackTrace();
        return  null;
    }

    @Override
    public Client getClientByClientId(String clientId) {
        log.error("getClientByClientId:{}", clientId, cause);
        cause.printStackTrace();
        return  null;
    }

    @Override
    public void deleteClient(String ids){
        log.error("deleteClient:{}", ids, cause);
        cause.printStackTrace();
    }
    @Override
    public Result<Client> saveOrUpdate(Client clientDto){
        log.error("saveOrUpdate:{}", clientDto, cause);
        cause.printStackTrace();
        return Result.fail("", cause.getMessage());
    }

    @Override
    public Result<String> getClientIdByAccessToken(String accessTokenValue) {
        log.error("getClientIdByAccessToken:{}", accessTokenValue, cause);
        cause.printStackTrace();
        return  null;
    }
}
